package entities;

import java.io.Serializable;

/**
 *
 * @author Dragan Sahpaski
 */
public class PrimaryKey implements Serializable{

    private Atribute atribute;
    private Table table;

    public PrimaryKey(Atribute atribute) {
        this.atribute = atribute;
    }

    public Table getTable() {
        return table;
    }

    public Atribute getAtribute() {
        return atribute;
    }

    public void setTable(Table table) {
        this.table = table;
        this.atribute.setTable(table);
        this.atribute.setNumberOfDistinctValues(table.getNumberOfTuples());
    }

    @Override
    public String toString() {
        return this.getAtribute().toString();
    }
}
